<?php

declare (strict_types=1);

namespace app\controller\admin;

use think\facade\View;
use think\facade\Db;
use app\controller\admin\Common;
use app\model\Log;

class Index extends Common
{
    public function index()
    {

        $mysql = Db::query("select VERSION() as mysql");
        $t = time() - 3600 * 24 * 60;

        Log::where("t < $t")->delete();
        $list = Log::order('id desc')->paginate(25);
        View::assign('list', $list);

        View::assign('mysql', $mysql[0]['mysql']);
        return View::fetch();
    }
}
